package com.hy.mydesktop.shared.rpc.util;


import com.hy.mydesktop.client.component.type.ComponentControllerEnum;
import com.hy.mydesktop.shared.persistence.domain.gxt.GxtComponentControllerMetaModel;
import com.hy.mydesktop.shared.persistence.domain.gxt.GxtComponentControllerMetaNodeModel;


/**
 * 
 * <ul>
 * <li>开发作者：花宏宇</li>
 * <li>设计日期：2010-10-26；时间：上午10:16:29</li>
 * <li>类型名称：ComponentControllerEnumConverter</li>
 * <li>设计目的：</li>
 * </ul>
 * <ul>
 * <b>修订编号：</b>
 * <li>修订日期：</li>
 * <li>修订作者：</li>
 * <li>修订原因：</li>
 * <li>修订内容：</li>
 * </ul>
 */
public class ComponentControllerEnumConverter {
	
	
	public static GxtComponentControllerMetaModel updateComponentControllerEnum(GxtComponentControllerMetaModel gxtComponentControllerMetaModel) {
		for (GxtComponentControllerMetaNodeModel gxtComponentControllerMetaNodeModel : gxtComponentControllerMetaModel.getList()) {
			updateComponentControllerEnum(gxtComponentControllerMetaNodeModel);
		}
		return gxtComponentControllerMetaModel;
	}
	/**
	 * 
	 * <ul>
	 * <li>方法含义：根据componentControllerEnumIndex，设置GxtComponentMetaNodeModel的ComponentControllerEnum</li>
	 * <li>方法作者：花宏宇</li>
	 * <li>编写日期：2010-10-26；时间：下午上午10:21:36</li>
	 * </ul>
	 * <ul>
	 * <b>修订编号：</b>
	 * <li>修订日期：</li>
	 * <li>修订作者：</li>
	 * <li>修订原因：</li>
	 * <li>修订内容：</li>
	 * </ul>
	 * @param gxtComponentControllerMetaNodeModel
	 * @return
	 */
	public static GxtComponentControllerMetaNodeModel updateComponentControllerEnum(GxtComponentControllerMetaNodeModel gxtComponentControllerMetaNodeModel) {
		gxtComponentControllerMetaNodeModel.setComponentControllerEnum(getComponentControllerEnum(gxtComponentControllerMetaNodeModel.getComponentControllerEnumIndex()));
		return gxtComponentControllerMetaNodeModel;
	}

	
	public static ComponentControllerEnum getComponentControllerEnum(int componentControllerEnumIndex) {
		GxtComponentControllerMetaNodeModel gxtComponentControllerMetaNodeModel = new GxtComponentControllerMetaNodeModel();
		
		switch (componentControllerEnumIndex) {
			case 0://ComponentControllerEnum.TREEPANELMODULES_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.TREEPANELMODULES_CONTROLLER_MODEL);
				break;

			case 1://ComponentControllerEnum.GRIDSETMODULES_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.GRIDSETMODULES_CONTROLLER_MODEL);				
				break;

			case 2://ComponentControllerEnum.GRID_MODULE_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.GRID_MODULE_CONTROLLER_MODEL);				
				break;

			case 3://ComponentControllerEnum.TREE_DATALOAD_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.TREE_DATALOAD_CONTROLLER_MODEL);				
				break;
							
			case 4://ComponentControllerEnum.GRID_DATALOAD_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.GRID_DATALOAD_CONTROLLER_MODEL);								
				break;				
			case 5://ComponentControllerEnum.DATALOAD_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.DATALOAD_CONTROLLER_MODEL);								
				break;
				
			case 6://ComponentControllerEnum.GRID_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.GRID_CONTROLLER_MODEL);								
				break;
			case 7://ComponentControllerEnum.DATEFIELD_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.DATEFIELD_CONTROLLER_MODEL);								
				break;
				
			case 8://ComponentControllerEnum.COMBOBOX_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.COMBOBOX_CONTROLLER_MODEL);								
				break;
				
			//case XXX6:
			//	gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.DATALOAD_CONTROLLER_MODEL);								
			//	break;
				
			case 9://ComponentControllerEnum.FORMSET_MODULE_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.FORMSET_MODULE_CONTROLLER_MODEL);
				break;
				
			case 10://ComponentControllerEnum.FORMMODULE_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.FORMMODULE_CONTROLLER_MODEL);
				break;
				
			case 11://ComponentControllerEnum.DESKTOP_STARTMENU_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.DESKTOP_STARTMENU_CONTROLLER_MODEL);
				break;
				
			
				
			case 12://ComponentControllerEnum.TEXTFIELD_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.TEXTFIELD_CONTROLLER_MODEL);
				break;

			case 13://ComponentControllerEnum.FORMPANEL_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.FORMPANEL_CONTROLLER_MODEL);
				break;
				
			case 14://ComponentControllerEnum.TOOLBAR_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.TOOLBAR_CONTROLLER_MODEL);
				break;
				
			case 15://ComponentControllerEnum.MENUBAR_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.MENUBAR_CONTROLLER_MODEL);
				break;
				
			case 16://ComponentControllerEnum.DESKTOP_MENUITEM_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.DESKTOP_MENUITEM_CONTROLLER_MODEL);
				break;
			case 17://ComponentControllerEnum.CONTENTPANEL_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.CONTENTPANEL_CONTROLLER_MODEL);
				break;
				
			case 18://ComponentControllerEnum.WINDOW_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.WINDOW_CONTROLLER_MODEL);
				break;
			case 19://ComponentControllerEnum.DESKTOP_CONTROL_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.DESKTOP_CONTROLLOR_MODEL);
				break;
				
			case 20://ComponentControllerEnum.DATALOAD_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.SHORTCUT_CONTROLLER_MODEL);
				break;
			case 21://ComponentControllerEnum.DATALOAD_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.TEXTAREA_CONTROLLER_MODEL);
				break;
			case 22://ComponentControllerEnum.DATALOAD_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.RADIOGROUP_CONTROLLER_MODEL);
				break;
			case 23://ComponentControllerEnum.DATALOAD_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.CHECKGROUP_CONTROLLER_MODEL);
				break;

			case 24://ComponentControllerEnum.DATALOAD_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.SIMPLECOMBOBOX_CONTROLLER_MODEL);
				break;
			case 25://ComponentControllerEnum.DATALOAD_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.TABPANEL_CONTROLLER_MODEL);
				break;
			case 26://ComponentControllerEnum.DATALOAD_CONTROLLER_MODEL.ordinal():
				gxtComponentControllerMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.TABITEM_CONTROLLER_MODEL);
				break;

			default:
				assert false : "Error converting componentControllerEnumIndex to ComponentControllerEnum : componentControllerEnumIndex = "+componentControllerEnumIndex;
				break;
		}
		return gxtComponentControllerMetaNodeModel.getComponentControllerEnum();
		/**
		 * 树形面板组件控制器
		 */
		
		
		/**
		 * 表格组件集合控制器
		 */
		

		
		/**
		 * 表格组件控制器
		 */
		//,
		
		/**
		 *树中数据加载的控制器 
		 */
		
		/**
		 *表格中数据加载的控制器 
		 */
		
		
		/**
		 *数据加载的控制器 
		 */
		
		
		/**
		 * 表格控制器
		 */
		

		
		/**
		 * 日期域控制器
		 */
		
		/**
		 * 复选框域控制器
		 */
		
		
		
		/**
		 * 表单集合组件控制器
		 */
		
		/**
		 * 表单组件控制器
		 */
		
		/**
		 * desktop开始菜单控制器
		 */
		
		/**
		 * 文本域控制器
		 */
		
		/**
		 * 表单面板控制器
		 */
		
		/**
		 * 工具栏控制器
		 */
		/**
		 * 菜单栏控制器
		 */
		/**
		 * 桌面开始菜单项MenuItem控制器
		 */
		/**
		 * 内容面板控制器
		 */
		/**
		 * 窗口控制器
		 */
		/**
		 * Desktop桌面
		 */
		/**
		 * 快捷方式
		 */
	}


}
